package cn.com.git.admin.server.api.feign.upms;

import cn.com.git.admin.service.dto.*;
import cn.com.git.admin.service.query.SysUserListQuery;
import cn.com.git.common.model.DataTree;
import cn.com.git.common.model.ResultMsg;
import cn.com.git.common.model.ResultPage;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

import java.util.List;

/**
 * 鉴权服务
 * @author zhangzhenfu
 * @Description
 * @date 2020/2/22 15:20
 */
public interface UpmsFeignService {
    /*
    sso 单点登录
    */
    @RequestLine("POST /upms/sso/login/password?account={account}&password={password}")
    @Headers({"Content-Type: application/x-www-form-urlencoded"})
    ResultMsg<AuthenticationDTO> ssoLoginByPassword(@Param("account") String account, @Param("password") String password);

    /*
           用户管理
        */
    @RequestLine("POST /sys_user/list/page")
    @Headers({"Content-Type: application/json"})
    ResultPage<SysUserListDTO> sysUserListPage(SysUserListQuery upmsPageQuery);
    @RequestLine("POST /sys_user/list/tree")
    @Headers({"Content-Type: application/json"})
    ResultMsg<List<DataTree>> sysUserListTree(SysUserListQuery upmsPageQuery);
    @RequestLine("GET /sys_user/find?id={id}")
    ResultMsg<SysUserDetailDTO> sysUserFind(@Param("id") Integer id);
    @RequestLine("POST /sys_user/add")
    @Headers({"Content-Type: application/json"})
    ResultMsg<SysUserSaveDTO> sysUserAdd(SysUserSaveDTO form);
    @RequestLine("POST /sys_user/edit")
    @Headers({"Content-Type: application/json"})
    ResultMsg<SysUserSaveDTO> sysUserEdit(SysUserSaveDTO form);
    @RequestLine("GET /sys_user/delete?id={id}")
    ResultMsg sysUserDelete(@Param("id") Integer id);
}
